package cn.edu.scau.cmi.liujianxun.client.fxUI.comprehension;

import javafx.fxml.FXML;

import javafx.scene.control.Button;
import javafx.stage.Stage;
import cn.edu.scau.cmi.liujianxun.client.*;
import javafx.event.ActionEvent;

public class ComprehensionDemoController {
	@FXML
	private Button btInterProgramming;
	@FXML
	private Button btSingleton;
	@FXML
	private Button btMultipleton;
	@FXML
	private Button btSimpleFactory;
	@FXML
	private Button btAdapterClass;
	@FXML
	private Button btAdapterObject;
	@FXML
	private Button btAbstractFactory;
	@FXML
	private Button btFactory;
	@FXML
	private Button btTransparentComposite;
	@FXML
	private Button btHibernate;
	@FXML
	private Button btSpring;
	@FXML
	private Button btSpringHibernate;
	@FXML
	private Button btSafeComposite;

	public void btInterProgrammingEvent(ActionEvent event) {
		Stage stage = new Stage();
		InterProgrammingClient client = new InterProgrammingClient();
		client.start(stage);
	}
	
	public void btSingletonEvent(ActionEvent event) {
		Stage stage = new Stage();
		SingletonClient client = new SingletonClient();
		client.start(stage);
	}
	
	public void btMultipletonEvent(ActionEvent event) {
		Stage stage = new Stage();
		MultipletonClient client = new MultipletonClient();
		client.start(stage);
	}
	
	public void btSimpleFactoryEvent(ActionEvent event) {
		Stage stage = new Stage();
		SimpleFactoryMethodClient client = new SimpleFactoryMethodClient();
		client.start(stage);
	}

	public void btFactoryEvent(ActionEvent event) {
		Stage stage = new Stage();
		FactoryClient client = new FactoryClient();
		client.start(stage);
	}
	
	public void btAbstractFactoryEvent(ActionEvent event) {
		Stage stage = new Stage();
		AbstractFactoryClient client = new AbstractFactoryClient();
		client.start(stage);
	}
	
	public void btAdapterObjectEvent(ActionEvent event) {
		Stage stage = new Stage();
		AdapterClient client = new AdapterClient();
		client.start(stage);
	}
	
	public void btAdapterClassEvent(ActionEvent event) {
		Stage stage = new Stage();
		AdapterClient client = new AdapterClient();
		client.start(stage);
	}

	public void btSafeCompositeEvent(ActionEvent event) {
		Stage stage = new Stage();
		SafeCompositeClient client = new SafeCompositeClient();
		client.start(stage);
	}
	
	public void btTransparentCompositeEvent(ActionEvent event) {
		Stage stage = new Stage();
		TransparentCompositeClient client = new TransparentCompositeClient();
		client.start(stage);
	}

	public void btHibernateEvent(ActionEvent event) {
		Stage stage = new Stage();
		HibernateClient client = new HibernateClient();
		client.start(stage);
	}

	public void btSpringEvent(ActionEvent event) {
		Stage stage = new Stage();
		SpringClient client = new SpringClient();
		client.start(stage);
	}

	public void btSpringHibernateEvent(ActionEvent event) {
		Stage stage = new Stage();
		SpringHibernateClient client = new SpringHibernateClient();
		client.start(stage);
	}
}
